<?php
class Del extends Controller {
	public function json() {
		$cid = $this->post('cid', 'int');
				
		if(!$cid) $this->displayJSON(array('status' => -1, 'message' => '未知分类'));
		
		$mProduct = new Product_model();
		$params = array('cid' => $cid);
		$result = $mProduct->delCategory($params);
		if($result) $this->displayJSON(array('status' => 0, 'message' => '删除节点成功'));
		else $this->displayJSON(array('status' => -2, 'message' => '删除节点失败'));
	}
}